Release 10.1A: OpenEdge Development:
ADM and SmartObjects
Getting records from an additional source
As with most other link types, it is valid for a Data-Target SmartObject to have only one Data-Source at a time. Sometimes, however, you must be able to pass a record down a different path than the normal Data link path. For example, suppose you have a a SmartDataViewer that receives Customer values from a SmartDataObject. When the SmartDataObject is notified of the
dataAvailableevent, it gets the Customer values for the current row in the Customer SmartDataObject. This sequence is repeated whenever the SmartDataObject retrieves a new Customer record. Occasionally, however, the SmartDataViewer might need a different record. For example, it might need the User record on startup, to perform security checks. This User record might not be available through its normal Data-Source.You can deal with this scenario in several ways. In addition to the default automatic execution of the
colValuesfunction in the Data-Source fromdataAvailable, you can program a SmartObject to runcolValuesin a SmartObject other than its regular Data-Source. This approach provides an ADM-standard way to get an extra set of values from one SmartObject to another. For example, you could define aninitializeUserlink from the source of the User ID to the SmartDataViewer that needs it. When you create a nonstandard link, Progress performs a singleSUBSCRIBEin the target for the link name. For example, if theinitializeUserprocedure is defined in the SmartDataViewer, it will be executed whenever the sourcePUBLISHes theinitializeUserevent. The User ID can be passed as an argument or queried from target to source.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |